class Solution:
    def calDPDScore(self, dpdInfo):
        # write code here
        last_token = 'N'
        max_num = 0
        tmp = 0
        for dp in dpdInfo:
            if dp == 'Y':
                tmp += 1
                max_num = max(max_num,tmp)
            if dp == 'N':
                tmp = 0
        if 0 < max_num <= 3:
            return -10
        if 3 < max_num <= 7:
            return -15
        if max_num>7:
            return -25
        return 0

dpdInfo = "YYN"
Solution().calDPDScore(dpdInfo)


#%%
class Solution:
    def GetSubArrayMaxProduct(self, nums) :
        # write code here
        def cal(arr):
            res = arr[0]
            for a in arr[1:]:
                res = res * a
            return res
        res = []
        for i in range(len(nums)):
            for j in range(i,len(nums)):
                length = len(nums)-i
                res.append(cal(nums[i:i+length]))
        return max(res)

nums= [2,3,-2,4,-1]
Solution().GetSubArrayMaxProduct(nums)




















#%%



















